package commands;
import Main.Command;
import net.dv8tion.jda.JDA;
import net.dv8tion.jda.JDABuilder;
import net.dv8tion.jda.events.DisconnectEvent;
import net.dv8tion.jda.events.channel.voice.GenericVoiceChannelEvent;
import net.dv8tion.jda.events.message.MessageReceivedEvent;
import net.dv8tion.jda.events.voice.VoiceJoinEvent;

public class ShutdownCommand implements Command{
	private static JDA jda;
	@Override
	public boolean called(String[] args, MessageReceivedEvent event) {
		// TODO Auto-generated method stub
		if(event.getAuthor().getId().equals("141311793237590017")){
			return true;
		}else{
		try {
			event.getTextChannel().sendMessage("I'm sorry, but Mr.Tumble says no!");
			Thread.sleep(2000);
			event.getTextChannel().sendMessage("https://cdn.discordapp.com/attachments/186463679347294208/186470986726506497/1800c828b0d84379c999793db7e3aa40.gif");
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
		return false;
	}

	@Override
	public void action(String[] args, MessageReceivedEvent event) {
		// TODO Auto-generated method stub
		if(event.getAuthor().getId().equals("141311793237590017")){
			long timeout = 0;
			try {
				event.getTextChannel().sendMessage("You have permission to use this command!");
				Thread.sleep(2000); 
				event.getTextChannel().sendMessage("But I have to refute your use of it.");
				Thread.sleep(2000); 
				event.getTextChannel().sendMessage("FINE I'LL LET YOU DO IT! Jesus.");
				Thread.sleep(2000); 
				event.getTextChannel().sendMessage("Mr.Tumble says 'YES BITCH!'");
				Thread.sleep(2000); 
				event.getTextChannel().sendMessage("https://cdn.discordapp.com/attachments/186463679347294208/186470986726506497/1800c828b0d84379c999793db7e3aa40.gif");
				System.exit(0);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		}
		
	}
	


	@Override
	public String help() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void execute(boolean success, MessageReceivedEvent event) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void action(String[] args, GenericVoiceChannelEvent event) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void action(String[] args, VoiceJoinEvent event) {
		// TODO Auto-generated method stub
		
	}

}
